//
//  FQDLabTitleImageCell.m
//  FakeQDaily
//
//  Created by mewxiv on 9/18/16.
//  Copyright © 2016 Xensius. All rights reserved.
//

#import "FQDLabTitleImageCell.h"
#import "FQDLabTitleImageView.h"
#import "FQDRestModel.h"

#import "Masonry.h"

@interface FQDLabTitleImageCell ()

@property (nonatomic, strong) FQDLabTitleImageView *titleImageView;

@end

@implementation FQDLabTitleImageCell

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self prepareUI];
    }
    return self;
}

- (void)prepareUI
{
    self.layer.masksToBounds = YES;
    
    _titleImageView = [[FQDLabTitleImageView alloc] init];
    [self.contentView addSubview:_titleImageView];
    
    WeakSelf;
    [_titleImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.equalTo(weakSelf.contentView);
    }];
    
}

#pragma mark - Getters and Setters
- (void)setPost:(FQDPost *)post
{
    _post = post;
    self.titleImageView.post = post;
}

+ (CGFloat)cellHeight
{
    return 200.0f;
}

+ (NSString *)reuseId
{
    return @"FQDLabTitleImageCell";
}
@end
